class MyArray<T> {
    public Object[] array = new Object[10];

    public void set(int pos, T val) {
        array[pos] = val;
    }

    public T get(int pos) {
        return (T) array[pos];
    }
}
public class demo2 {
    public static void main(String[] args) {
        MyArray<String> myArray = new MyArray<>();
        MyArray<Integer> myArray1 = new MyArray<>();
        myArray.set(1, "abc");
        myArray1.set(2,123);
        String str = myArray.get(1);
        System.out.println(myArray1.get(2));
        System.out.println(str);
    }
}